package com.shuqi.database.model;

import java.io.Serializable;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.shuqi.database.dao.OrmBaseModel;

/**
 * 
 * 书籍信息相关字段
 * 
 * @author hxp
 * @date 2014-3-9
 * 
 */
@DatabaseTable(tableName = "book_info")
public class BookInfo extends OrmBaseModel implements Serializable{

    private static final long serialVersionUID = 6414730751138068295L;
    public static final int IN_HISTORY = 1; // 在浏览历史中
    public static final int UNIN_HISTORY = 0; // 不在浏览历史中

    /** payMode */
    public static final int FREE = 0; // 0免费
    public static final int ALL_BOOK = 1; // 1全本
    public static final int ALL_CHAPTER = 2; // 2按章
    public static final int ALL_BOOK_FREE = 3; // 3全本免费

    /** 状态位 */
    public static final int HIDEN = 0; // 状态位0-隐藏
    public static final int OPEN = 1; // 状态位1-开放

    /** 全本状态位 */
    public static final String BOOK_HIDEN = "Y"; // 状态位Y-隐藏
    public static final String BOOK_OPEN = "N"; // 状态位N-开放

    /** 支付状态 */
    public static final int HAS_PAY = 1; // 1表示支付
    public static final int UN_PAY = 0; // 0表示未支付

    /** 来源类型 */
    public static final int SOURCE_TYPE_SHUQI = 1; // 1书旗
    public static final int SOURCE_TYPE_SHEENME = 2; // 2神马
    
    /**是否需要更新目录：需要 */
    public static final int UPDATE_CATALOG_YES = 1;
    /**是否需要更新目录：不需要 */
    public static final int UPDATE_CATALOG_NO = 0; 
    

    /* 自动购买状态 */
    /** 默认手动购买(checkbox true) */
    public static final int DEFAULT_NO_AUTO_BUY = 0; // 默认状态,勾选
    /** 自动购买 */
    public static final int AUTO_BUY = 1; // 自动购买
    /** 手动购买(checkbox false) */
    public static final int NO_AUTO_BUY = 2; // 不自动购买，不勾选


    public static final int ILLEGAL_VALUE = -1; // 非法值（当没有设置值的时候赋值为非法值，一遍数据库校验）

    /** 数据库自增主键 */
    @DatabaseField(generatedId = true)
    private int _id;

    /** 书籍ID */
    @DatabaseField(columnName = "book_id")
    private String bookId;

    /** 书籍来源ID */
    @DatabaseField(columnName = "source_id")
    private String sourceId;

    /** 书籍封面图 */
    @DatabaseField(columnName = "book_cover_img_url")
    private String bookCoverImgUrl;

    /** 书籍名称 */
    @DatabaseField(columnName = "book_name")
    private String bookName;

    /** 书籍作者姓名 */
    @DatabaseField(columnName = "book_author_name")
    private String bookAuthorName;

    /** 书籍类型 */
    @DatabaseField(columnName = "book_type")
    private String bookType;

    /** 书籍付费模式 */
    @DatabaseField(columnName = "book_pay_mode")
    private int bookPayMode = ILLEGAL_VALUE;

    /** 书籍价格 */
    @DatabaseField(columnName = "book_price")
    private float bookPrice = ILLEGAL_VALUE;

    /** 书籍付费状态 */
    @DatabaseField(columnName = "book_pay_state")
    private int bookPayState = ILLEGAL_VALUE;

    /** 书籍已下载数量 */
    @DatabaseField(columnName = "book_down_count")
    private int bookDownCount = ILLEGAL_VALUE;

    /** 书籍更新时间 */
    @DatabaseField(columnName = "book_update_time")
    private long bookUpdateTime;

    /** 书籍总字数 */
    @DatabaseField(columnName = "book_word_count")
    private String bookWordCount;

    /** 书籍 完结 连载 状态 */
    @DatabaseField(columnName = "book_status")
    private String bookStatus;

    /** 书籍 简介 */
    @DatabaseField(columnName = "book_intro")
    private String bookIntro;

    /** 书籍 总控状态位 */
    @DatabaseField(columnName = "book_hide_state")
    private String bookHideState;

    /** 书籍 封面状态位 */
    @DatabaseField(columnName = "cover_hide_state")
    private int coverHideState = ILLEGAL_VALUE;

    /** 书籍阅读状态位 */
    @DatabaseField(columnName = "read_hide_state")
    private int readHideState = ILLEGAL_VALUE;

    /** 书籍阅读历史标志 */
    @DatabaseField(columnName = "book_history_state")
    private int bookHistoryState = ILLEGAL_VALUE;

    /** 书籍最大章节数 */
    @DatabaseField(columnName = "book_max_oid")
    private int bookMaxOid;

    /** 书籍用户ID */
    @DatabaseField(columnName = "user_id")
    private String userId;

    /** 书籍来源类型 */
    @DatabaseField(columnName = "source_type")
    private int sourceType = ILLEGAL_VALUE;

    /** 书籍自动购买状态 */
    @DatabaseField(columnName = "book_auto_buy_state")
    private int bookAutoBuyState;

    /** 是否需要更新目录 */
    @DatabaseField(columnName = "update_catalog")
    private int updateCatalog = ILLEGAL_VALUE;
    
    private String discount;// 是否优惠

    public int getSourceType() {
        return sourceType;
    }

    public void setSourceType(int sourceType) {
        this.sourceType = sourceType;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public String getBookCoverImgUrl() {
        return bookCoverImgUrl;
    }

    public void setBookCoverImgUrl(String bookCoverImgUrl) {
        this.bookCoverImgUrl = bookCoverImgUrl;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getBookAuthorName() {
        return bookAuthorName;
    }

    public void setBookAuthorName(String bookAuthorName) {
        this.bookAuthorName = bookAuthorName;
    }

    public String getBookType() {
        return bookType;
    }

    public void setBookType(String bookType) {
        this.bookType = bookType;
    }

    public int getBookPayMode() {
        return bookPayMode;
    }

    public void setBookPayMode(int bookPayMode) {
        this.bookPayMode = bookPayMode;
    }

    public float getBookPrice() {
        return bookPrice;
    }

    public void setBookPrice(float bookPrice) {
        this.bookPrice = bookPrice;
    }

    public int getBookPayState() {
        return bookPayState;
    }

    public void setBookPayState(int bookPayState) {
        this.bookPayState = bookPayState;
    }

    public int getBookDownCount() {
        return bookDownCount;
    }

    public void setBookDownCount(int bookDownCount) {
        this.bookDownCount = bookDownCount;
    }

    public long getBookUpdateTime() {
        return bookUpdateTime;
    }

    public void setBookUpdateTime(long bookUpdateTime) {
        this.bookUpdateTime = bookUpdateTime;
    }

    public String getBookWordCount() {
        return bookWordCount;
    }

    public void setBookWordCount(String bookWordCount) {
        this.bookWordCount = bookWordCount;
    }

    public String getBookStatus() {
        return bookStatus;
    }

    public void setBookStatus(String bookStatus) {
        this.bookStatus = bookStatus;
    }

    public String getBookIntro() {
        return bookIntro;
    }

    public void setBookIntro(String bookIntro) {
        this.bookIntro = bookIntro;
    }

    public String getBookHideState() {
        return bookHideState;
    }

    public void setBookHideState(String bookHideState) {
        this.bookHideState = bookHideState;
    }

    public int getCoverHideState() {
        return coverHideState;
    }

    public void setCoverHideState(int coverHideState) {
        this.coverHideState = coverHideState;
    }

    public int getReadHideState() {
        return readHideState;
    }

    public void setReadHideState(int readHideState) {
        this.readHideState = readHideState;
    }

    public int getBookHistoryState() {
        return bookHistoryState;
    }

    public void setBookHistoryState(int bookHistoryState) {
        this.bookHistoryState = bookHistoryState;
    }

    public int getBookMaxOid() {
        return bookMaxOid;
    }

    public void setBookMaxOid(int bookMaxOid) {
        this.bookMaxOid = bookMaxOid;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getBookAutoBuyState() {
        return bookAutoBuyState;
    }

    public void setBookAutoBuyState(int bookAutoBuyState) {
        this.bookAutoBuyState = bookAutoBuyState;
    }

    public String getDiscount() {
        return discount;
    }

    public void setDiscount(String discount) {
        this.discount = discount;
    }

    public int getUpdateCatalog() {
        return updateCatalog;
    }

    public void setUpdateCatalog(int updateCatalog) {
        this.updateCatalog = updateCatalog;
    }


}
